var login=({
	loginBtn : function (){
		var phone= $("#phone").val(),
		password= $("#password").val();
	if( !phone ){
		$$.toast("请输入手机号码");
		return ;
	}
	if( !password ){
		$$.toast("请输入密码");
		return;
	}
	$$.showPreloader("登陆中");
	$.ajax({
		type : "POST",
		dataType : 'json',
		url : "../login/ljLogin.do",
		data : {
			"phone": phone,
			"password": password,
			"flag": flag
		},
		success : function(data) {
			
			$$.hidePreloader();
			if( data.resultCode=="0" && data.content){
				document.cookie="phone="+phone;
				if(preUrl!=null){
					window.location = preUrl;
					return ;
				}else{
					if(flag=="0"){
						window.location ='./zukeKongjian.html' ;
					}else if( flag=="1" ){
						window.location ='./yezhuKongjian.html' ;
					}else if( flag=="2" ){
						if(data.content.flag=='2'){
							window.location ='./GuanJiaList.html' ;
						}else{
							$$.toast("抱歉，您不是管家");
							return false;
						}
						
					}
					else{
						window.location ='../jsp/home.html' ;
					}
				}

				
			}else{
				$$.toast(data.msg||"账号或密码错误");
			}
		},
		error: function(){
			$$.hidePreloader();
			$$.toast("登陆出错");
		}
	});
	}
})

